package com.niit.mall.api.fallback;


import com.niit.mall.api.client.AddressClient;
import com.niit.mall.api.domain.vo.AddressVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @BelongsProject: pardo_mall_backend
 * @BelongsPackage: com.niit.mall.api.fallback
 * @Author: ChuXuan
 * @CreateTime: 2025-06-06  16:21
 * @Description: 地址服务降级处理
 * @Version: 1.0
 */
@Slf4j
public class AddressClientFallbackFactory implements FallbackFactory<AddressClient> {
	@Override
	public AddressClient create(Throwable throwable) {
		return new AddressClient() {
			@Override
			public List<AddressVO> queryAddressByUserId(Long id) {
				log.error("查询地址失败", throwable);
				return List.of();
			}
			
		};
	}
}
